#include    "Textures/TextureSampler.h"

GLenum  TSampler :: getSWrap () const
{
    GLenum sWrap;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_WRAP_S, (GLint *)&sWrap );

    return sWrap;
}

GLenum  TSampler :: getTWrap () const
{
    GLenum tWrap;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_WRAP_T, (GLint *)&tWrap );

    return tWrap;
}

GLenum  TSampler :: getRWrap () const
{
    GLenum rWrap;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_WRAP_R, (GLint *)&rWrap );

    return rWrap;
}

GLenum  TSampler :: getMinFilter () const
{
    GLenum filter;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_MIN_FILTER, (GLint *)&filter );
    
    return filter;
}

GLenum  TSampler :: getMagFilter () const
{
    GLenum filter;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_MAG_FILTER, (GLint *)&filter );
    
    return filter;
}

int     TSampler :: getMinLod  () const
{
    int lod;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_MIN_LOD, &lod );
    
    return lod;
}

int     TSampler :: getMaxLod  () const
{
    int lod;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_MAX_LOD, &lod );
    
    return lod;
}

float   TSampler :: getLodBias () const
{
    float   bias;
    
    glGetSamplerParameterfv ( id, GL_TEXTURE_LOD_BIAS, &bias );
    
    return bias;
}

float   TSampler :: getMaxAnisotropy () const
{
    float   anisotropy;
    
    glGetSamplerParameterfv ( id, GL_TEXTURE_MAX_ANISOTROPY_EXT, &anisotropy );
    
    return anisotropy;
}

GLenum  TSampler :: getTextureCompareMode () const
{
    GLenum  mode;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_COMPARE_MODE, (GLint *)&mode );
    
    return mode;
}

GLenum  TSampler :: getTextureCompareFunc () const
{
    GLenum func;
    
    glGetSamplerParameteriv ( id, GL_TEXTURE_COMPARE_FUNC, (GLint *)&func );
    
    return func;
}

GLuint TSampler :: activeSampler ()
{
    GLuint  sampler;
    
    glGetIntegerv ( GL_SAMPLER_BINDING, (GLint *)&sampler );
    
    return sampler;
}